<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>03.vue中同时使用过度和动画</title>
    <link rel="stylesheet" href="animate.css">
</head>
<style>
    .fade-enter, .fade-leave-to {
        opacity: 0;
    }
    .fade-enter-active, .fade-leave-active {
        transition: opacity 3s;
    }
</style>
<body>
    <div id="app">
        <transition 
        type="transition"
        :duration="{enter: 5000, leave: 5000}"
        name="fade"
        appear
        enter-active-class="animated swing fade-enter-active" 
        leave-active-class="animated shake fade-leave-active"
        appear-active-class="animated swing">
            <div v-show="show">hello world</div>
        </transition>

        <button @click="handleClick">切换</button>
    </div>
</body>
<script src="vue.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            show: true
        },
        methods: {
            handleClick: function() {
                this.show = !this.show;
            }
        }
    })
</script>
</html>